const express = require('express');
const { routeWrapper } = require('../../../lib/module/tool/route');
const router = express.Router();
const chargeService = require('../../../lib/service/chargeService');

// 提交支付
router.post('/:areaId/submitcharge', routeWrapper(async (req) => {
    return chargeService.submitCharge(req.auth.userId, req.body.areaId, req.body.chargePackageId, req.body.fee, req.body.giftFee);
}, true));

// 支付回调
// 校验订单支付状态
router.post('/:orderId/orderRecordPaymentNotify', routeWrapper(async (req) => {
    return chargeService.orderRecordPaymentNotify(req.params.orderId);
}, true));

module.exports = router;
